package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.internetofthings.firefightingiot;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.internetofthings.firefightingiot.ReportService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @author Yang yu
 * @version 1.0
 * @date 2020/7/28 13:53
 */
@Action
@RequestMapping(value="fireFightingIOT/report")
public class ReportController extends BaseController {


    @Resource
    private ReportService reportService;

    /**
     * 报告导出
     * @param jsonParam
     * @return
     * @throws Exception
     */
    @At(value = "getReport", method = RequestMethod.GET)
    public ResponseEntity<byte[]> getReport(@RequestBody(required = false) JSONObject jsonParam ) throws Exception {
        return reportService.getReport(jsonParam);
    }

}
